\(\int \frac {\sqrt {-1+\frac {1}{x}} \sqrt {\frac {1}{x}} \sqrt {x}}{\sqrt {1+x}} \, dx\) [870]

   Optimal result
   Rubi [B] (verified)
   Mathematica [C] (verified)
   Maple [B] (verified)
   Fricas [C] (verification not implemented)
   Sympy [F(-2)]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 29, antiderivative size = 24 \[ \int \frac {\sqrt {-1+\frac {1}{x}} \sqrt {\frac {1}{x}} \sqrt {x}}{\sqrt {1+x}} \, dx=-\frac {2 \sqrt {-x} E\left (\left .\arcsin \left (\sqrt {-x}\right )\right |-1\right )}{\sqrt {x}} \]

[Out]

-2*EllipticE((-x)^(1/2),I)*(-x)^(1/2)/x^(1/2)

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(49\) vs. \(2(24)=48\).

Time = 0.01 (sec) , antiderivative size = 49, normalized size of antiderivative = 2.04, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {15, 446, 112, 111} \[ \int \frac {\sqrt {-1+\frac {1}{x}} \sqrt {\frac {1}{x}} \sqrt {x}}{\sqrt {1+x}} \, dx=-\frac {2 \sqrt {\frac {1}{x}-1} \sqrt {\frac {1}{x}} \sqrt {-x} \sqrt {x} E\left (\left .\arcsin \left (\sqrt {-x}\right )\right |-1\right )}{\sqrt {1-x}} \]

[In]

Int[(Sqrt[-1 + x^(-1)]*Sqrt[x^(-1)]*Sqrt[x])/Sqrt[1 + x],x]

[Out]

(-2*Sqrt[-1 + x^(-1)]*Sqrt[x^(-1)]*Sqrt[-x]*Sqrt[x]*EllipticE[ArcSin[Sqrt[-x]], -1])/Sqrt[1 - x]

Rule 15

Int[(u_.)*((a_.)*(x_)^(n_))^(m_), x_Symbol] :> Dist[a^IntPart[m]*((a*x^n)^FracPart[m]/x^(n*FracPart[m])), Int[
u*x^(m*n), x], x] /; FreeQ[{a, m, n}, x] &&  !IntegerQ[m]

Rule 111

Int[Sqrt[(e_) + (f_.)*(x_)]/(Sqrt[(b_.)*(x_)]*Sqrt[(c_) + (d_.)*(x_)]), x_Symbol] :> Simp[2*(Sqrt[e]/b)*Rt[-b/
d, 2]*EllipticE[ArcSin[Sqrt[b*x]/(Sqrt[c]*Rt[-b/d, 2])], c*(f/(d*e))], x] /; FreeQ[{b, c, d, e, f}, x] && NeQ[
d*e - c*f, 0] && GtQ[c, 0] && GtQ[e, 0] &&  !LtQ[-b/d, 0]

Rule 112

Int[Sqrt[(e_) + (f_.)*(x_)]/(Sqrt[(b_.)*(x_)]*Sqrt[(c_) + (d_.)*(x_)]), x_Symbol] :> Dist[Sqrt[(-b)*x]/Sqrt[b*
x], Int[Sqrt[e + f*x]/(Sqrt[(-b)*x]*Sqrt[c + d*x]), x], x] /; FreeQ[{b, c, d, e, f}, x] && NeQ[d*e - c*f, 0] &
& GtQ[c, 0] && GtQ[e, 0] && LtQ[-b/d, 0]

Rule 446

Int[((c_) + (d_.)*(x_)^(mn_.))^(q_)*((a_) + (b_.)*(x_)^(n_.))^(p_), x_Symbol] :> Dist[x^(n*FracPart[q])*((c +
d/x^n)^FracPart[q]/(d + c*x^n)^FracPart[q]), Int[(a + b*x^n)^p*((d + c*x^n)^q/x^(n*q)), x], x] /; FreeQ[{a, b,
 c, d, n, p, q}, x] && EqQ[mn, -n] &&  !IntegerQ[q] &&  !IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = \left (\sqrt {\frac {1}{x}} \sqrt {x}\right ) \int \frac {\sqrt {-1+\frac {1}{x}}}{\sqrt {1+x}} \, dx \\ & = \frac {\sqrt {-1+\frac {1}{x}} \int \frac {\sqrt {1-x}}{\sqrt {x} \sqrt {1+x}} \, dx}{\sqrt {1-x} \sqrt {\frac {1}{x}}} \\ & = \frac {\left (\sqrt {-1+\frac {1}{x}} \sqrt {-x}\right ) \int \frac {\sqrt {1-x}}{\sqrt {-x} \sqrt {1+x}} \, dx}{\sqrt {1-x} \sqrt {\frac {1}{x}} \sqrt {x}} \\ & = -\frac {2 \sqrt {-1+\frac {1}{x}} \sqrt {-x} E\left (\left .\sin ^{-1}\left (\sqrt {-x}\right )\right |-1\right )}{\sqrt {1-x} \sqrt {\frac {1}{x}} \sqrt {x}} \\ \end{align*}

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 5 vs. order 4 in optimal.

Time = 10.04 (sec) , antiderivative size = 66, normalized size of antiderivative = 2.75 \[ \int \frac {\sqrt {-1+\frac {1}{x}} \sqrt {\frac {1}{x}} \sqrt {x}}{\sqrt {1+x}} \, dx=-\frac {2 \sqrt {\frac {x}{1+x}} \sqrt {1-x^2} \left (-3 \operatorname {Hypergeometric2F1}\left (\frac {1}{4},\frac {1}{2},\frac {5}{4},x^2\right )+x \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {3}{4},\frac {7}{4},x^2\right )\right )}{3 \sqrt {1-x}} \]

[In]

Integrate[(Sqrt[-1 + x^(-1)]*Sqrt[x^(-1)]*Sqrt[x])/Sqrt[1 + x],x]

[Out]

(-2*Sqrt[x/(1 + x)]*Sqrt[1 - x^2]*(-3*Hypergeometric2F1[1/4, 1/2, 5/4, x^2] + x*Hypergeometric2F1[1/2, 3/4, 7/
4, x^2]))/(3*Sqrt[1 - x])

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(48\) vs. \(2(18)=36\).

Time = 1.79 (sec) , antiderivative size = 49, normalized size of antiderivative = 2.04

method result size
default \(-\frac {2 \sqrt {\frac {1}{x}}\, \sqrt {x}\, \sqrt {-\frac {-1+x}{x}}\, E\left (\sqrt {1+x}, \frac {\sqrt {2}}{2}\right ) \sqrt {-x}\, \sqrt {2-2 x}}{-1+x}\) \(49\)
derivativedivides \(\frac {2 x^{\frac {5}{2}} \left (\frac {1}{x}\right )^{\frac {5}{2}} \sqrt {\left (\frac {1}{x}+1\right ) x}\, \sqrt {-1+\frac {1}{x}}\, \left (\sqrt {\frac {1}{x}+1}\, \sqrt {2}\, \sqrt {1-\frac {1}{x}}\, \sqrt {-\frac {1}{x}}\, E\left (\sqrt {\frac {1}{x}+1}, \frac {\sqrt {2}}{2}\right )-\sqrt {\frac {1}{x}+1}\, \sqrt {2}\, \sqrt {1-\frac {1}{x}}\, \sqrt {-\frac {1}{x}}\, F\left (\sqrt {\frac {1}{x}+1}, \frac {\sqrt {2}}{2}\right )+\frac {1}{x^{2}}-1\right )}{\frac {1}{x^{2}}-1}\) \(120\)

[In]

int((-1+1/x)^(1/2)*(1/x)^(1/2)*x^(1/2)/(1+x)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-2*(1/x)^(1/2)*x^(1/2)*(-(-1+x)/x)^(1/2)*EllipticE((1+x)^(1/2),1/2*2^(1/2))*(-x)^(1/2)*(2-2*x)^(1/2)/(-1+x)

Fricas [C] (verification not implemented)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 0.07 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.67 \[ \int \frac {\sqrt {-1+\frac {1}{x}} \sqrt {\frac {1}{x}} \sqrt {x}}{\sqrt {1+x}} \, dx=-2 i \, {\rm weierstrassPInverse}\left (4, 0, x\right ) - 2 i \, {\rm weierstrassZeta}\left (4, 0, {\rm weierstrassPInverse}\left (4, 0, x\right )\right ) \]

[In]

integrate((-1+1/x)^(1/2)*(1/x)^(1/2)*x^(1/2)/(1+x)^(1/2),x, algorithm="fricas")

[Out]

-2*I*weierstrassPInverse(4, 0, x) - 2*I*weierstrassZeta(4, 0, weierstrassPInverse(4, 0, x))

Sympy [F(-2)]

Exception generated. \[ \int \frac {\sqrt {-1+\frac {1}{x}} \sqrt {\frac {1}{x}} \sqrt {x}}{\sqrt {1+x}} \, dx=\text {Exception raised: RecursionError} \]

[In]

integrate((-1+1/x)**(1/2)*(1/x)**(1/2)*x**(1/2)/(1+x)**(1/2),x)

[Out]

Exception raised: RecursionError >> maximum recursion depth exceeded in comparison

Maxima [F]

\[ \int \frac {\sqrt {-1+\frac {1}{x}} \sqrt {\frac {1}{x}} \sqrt {x}}{\sqrt {1+x}} \, dx=\int { \frac {\sqrt {\frac {1}{x} - 1}}{\sqrt {x + 1}} \,d x } \]

[In]

integrate((-1+1/x)^(1/2)*(1/x)^(1/2)*x^(1/2)/(1+x)^(1/2),x, algorithm="maxima")

[Out]

integrate(sqrt(1/x - 1)/sqrt(x + 1), x)

Giac [F]

\[ \int \frac {\sqrt {-1+\frac {1}{x}} \sqrt {\frac {1}{x}} \sqrt {x}}{\sqrt {1+x}} \, dx=\int { \frac {\sqrt {\frac {1}{x} - 1}}{\sqrt {x + 1}} \,d x } \]

[In]

integrate((-1+1/x)^(1/2)*(1/x)^(1/2)*x^(1/2)/(1+x)^(1/2),x, algorithm="giac")

[Out]

integrate(sqrt(1/x - 1)/sqrt(x + 1), x)

Mupad [F(-1)]

Timed out. \[ \int \frac {\sqrt {-1+\frac {1}{x}} \sqrt {\frac {1}{x}} \sqrt {x}}{\sqrt {1+x}} \, dx=\int \frac {\sqrt {x}\,\sqrt {\frac {1}{x}-1}\,\sqrt {\frac {1}{x}}}{\sqrt {x+1}} \,d x \]

[In]

int((x^(1/2)*(1/x - 1)^(1/2)*(1/x)^(1/2))/(x + 1)^(1/2),x)

[Out]

int((x^(1/2)*(1/x - 1)^(1/2)*(1/x)^(1/2))/(x + 1)^(1/2), x)